﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

using WorkStation.Frameworks.Configuration.Elements;

namespace WorkStation.Frameworks.EasyBus.Configurations
{
    public class SubscribeConfiguration : BaseConfiguration
    {
        [XmlAttribute("routeKey")]
        public string RouteKey { get; set; }

        [XmlAttribute("busName")]
        public string BusName { get; set; }

        [XmlAttribute("endpointName")]
        public string EndpointName { get; set; }

        [XmlAttribute("description")]
        public string Description { get; set; }

        [XmlElement("listener")]
        public ListenerConfiguration ListenerConfig { get; set; }
    }

    public class SubscribeConfigurationCollection : BaseConfigurationCollection<SubscribeConfiguration>
    {
        [XmlElement("subscribe")]
        public List<SubscribeConfiguration> Subscribes 
        {
            get { return this._list; }
            set { this._list = value; }
        }
    }

    public class HandleConfiguration : BaseConfiguration
    {

    }

    public class ListenerConfiguration
    {
        [XmlAttribute("processThreadCount")]
        public int ProcessThreadCount { get; set; }

        [XmlElement("handle")]
        public HandleConfiguration[] Handles { get; set; }
    }
}
